<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.wxtf.platform.plugins.user.*"%>
<%@page import="java.text.SimpleDateFormat"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
UserBean user = (UserBean)request.getSession().getAttribute("userBean");

String _db = user.getDbType();
String orgId = request.getParameter("orgId");
SimpleDateFormat _formatChinese = new SimpleDateFormat("yyyy年MM月");
String mdate = _formatChinese.format(new Date());
String title = user.getCurOrgName()+mdate+"份临时用工人数";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<base href="<%=basePath%>"/>
		<meta http-equiv="pragma" content="no-cache"/>
		<meta http-equiv="cache-control" content="no-cache"/>
		<meta http-equiv="expires" content="0"/>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/Aqua/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/<%=user.getUserCss()%>/css/ligerui-all.css" />
		<link type="text/css" rel="stylesheet" href="ligerUI/skins/ligerui-icons.css" />
		<link type="text/css" rel="stylesheet" href="resource/css/style.css" />
	
		<script type="text/javascript" src="js/jquery/jquery-1.7.2.js"></script>
		<script type="text/javascript" src="ligerUI/js/core/base.js"></script>
		<script type="text/javascript" src="ligerUI/js/ligerui.min.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
		<script type="text/javascript" src="js/validata.js"></script>

		<script type="text/javascript" src="ligerUI/js/plugins/ligerGrid.js"></script>
		<script type="text/javascript" src="ligerUI/js/plugins/ligerTree.js"></script>
		<script type="text/javascript" src="ligerUI/js/plugins/ligerForm.js"></script>
		<script type="text/javascript" src="ligerUI/js/plugins/ligerDateEditor.js"></script>
		
		<script type="text/javascript" src="ligerUI/jquery-validation/jquery.validate.min.js" ></script> 
		<script type="text/javascript" src="ligerUI/jquery-validation/jquery.metadata.js"></script>
		<script type="text/javascript" src="ligerUI/jquery-validation/messages_cn.js" ></script>
	
		<script type="text/javascript">
			var _db = '<%=_db%>';
			var manager;//人员表格
			_jsonObj.classname = "com.wxtf.platform.main.employee.EmpTemporary";
			_jsonObj.methodname = "queryAll";
			_jsonObj.logicdata = "[{\"orgId\":\"<%=orgId%>\"}]";
			
			$(function(){
				manager = $("#emp-grid").ligerGrid({
					url: _url, parms: _jsonObj, width: '100%', height: '100%', isScroll: true,
					usePager: false, rownumbers: false, checkbox: false, alternatingRow: false,tree: { columnId: 'id1' },
					columns: [
						{ display: 'tbt_id', name: 'tbt_id', hide: true,width:1 },
						{ display: 'org_id', name: 'org_id', hide: true,width:1 },
						{ display: '单位', name: 'name',id:'id1', width: 200, align: 'left'},
						{ display: '人数', name: 'num', width: 200, align: 'left'}
					]
				});
            });
            function collapse()
	        {
	        	var array = manager.getData()[0].children;
	        	for(var i = 0; i < array.length; i++){
	        		manager.collapse(array[i]);
	        	}
	        }
            function expand()
	        {
	        	var array = manager.getData()[0].children;
	        	for(var i = 0; i < array.length; i++){
	        		manager.expand(array[i]);
	        	}
	        }
		</script>
	</head>
  
  	<body>
  		<input class="btn2" value="展开" type="button" onclick="expand();" />
  		<input class="btn2" value="收缩" type="button" onclick="collapse();" />
  		<center><h2 style="display:block;padding:10px 0;"><%=title %></h2></center>
	    <div id="emp-grid"></div>
	</body>
</html>
